
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台欢迎页</title>
	<link rel="stylesheet" href="../css/reset.css" />
	<link rel="stylesheet" href="../css/content.css" />
	<link href="../css/bootstrap.min.css" rel="stylesheet">
</head>
<body marginwidth="0" marginheight="0">
	<div class="container">
		<div class="public-nav">您当前的位置：<a href="">文章管理</a></div>
		<div class="public-content">
			<div class="public-content-header">
				<h3>文章列表</h3>
			</div>
			<div class="row clearfix">
				<div class="col-md-12 column">
					<form action="modify.php" method="get">
					<table class="table table-hover table-striped">
					<tr class="success">
						<th>ID</th>
						<th>标题</th>
						<th>所属菜单</th>
						<th>状态</th>
						<th>查看</th>
						<th>时间</th>
						<th>操作</th>
					</tr>
					<?php
					include_once('../db.php');
					$db=new DB();
					$sql="select * from article";
					$res=$db->get($sql);
					if (empty($res)) {
						echo "后台文章为空，请去后台管理添加";
					} else {
						for($i=0; $i<count($res); $i++) {  
					 ?> 
					<tr>
					   <td class="success"><?php echo $res[$i][0]?></td>
					   <td class="info"><?php echo $res[$i][1]?></td>
					   <td class="warning"><?php echo $res[$i][2]?></td>
					   <td class="info"><?php echo htmlspecialchars_decode($res[$i][3]);?></td>
					   <td class="active">
					   		<a href='modify.php?act=update&id=<?php echo $res[$i][0]?>"'>查看</a>
						</td>
					   <td class="success"><?php echo $res[$i][5]?></td>
					   <td class="active">
					   		<a href="modify.php?act=update&id=<?php echo $res[$i][0]?>">修改</a>
						    <a href="article_del.php?act=del&id=<?php echo $res[$i][0]?>">删除</a>
					   </td>
					</tr>
					<?php
                     }
					}
					?>
					</table>
				</form>
			</div>
		</div>
	</div>
</body>
</html>
